/*
 * Created on 2005-6-6
 *
 */
package com.hd123.rumba.util;

import java.math.BigDecimal;

/**
 * @author caili
 */
public class TRQuantityPriceTotal {
  /** 数量 */
  BigDecimal quantity = BigDecimal.ZERO;
  /** 去税单价 */
  BigDecimal unitPrice = BigDecimal.ZERO;
  /** 含税单价 */
  BigDecimal grossUnitPrice = BigDecimal.ZERO;
  /** 去税金额 */
  BigDecimal amount = BigDecimal.ZERO;
  /** 含税金额 */
  BigDecimal total = BigDecimal.ZERO;
  /** 税额 */
  BigDecimal tax = BigDecimal.ZERO;
  /** 税率 */
  BigDecimal taxRate = BigDecimal.ZERO;
  /**
   * 以下的指示量中, 必须且只能有两个是true. CalculateQuantityPrictTotal将根据这两个量计算其它量
   */
  boolean isQuantityFixed = false;
  boolean isUnitPriceFixed = false;
  boolean isGrossUnitPriceFixed = false;
  boolean isTotalFixed = false;
  boolean isAmountFixed = false;
  boolean isTaxFixed = false;
  String promotionMark = null;

  public TRQuantityPriceTotal() {
    super();
  }

  public TRQuantityPriceTotal(TRQuantityPriceTotal r) {
    super();
    assign(r);
  }

  public void assign(TRQuantityPriceTotal r) {
    this.setAmount(r.getAmount());
    this.setAmountFixed(r.isAmountFixed());
    this.setGrossUnitPrice(r.getGrossUnitPrice());
    this.setGrossUnitPriceFixed(r.isGrossUnitPriceFixed());
    this.setPromotionMark(r.getPromotionMark());
    this.setQuantity(r.getQuantity());
    this.setQuantityFixed(r.isQuantityFixed());
    this.setTax(r.getTax());
    this.setTaxFixed(r.isTaxFixed());
    this.setTaxRate(r.getTaxRate());
    this.setTotal(r.getTotal());
    this.setTotalFixed(r.isTotalFixed());
    this.setUnitPrice(r.getUnitPrice());
    this.setUnitPriceFixed(r.isUnitPriceFixed());
  }

  public BigDecimal getAmount() {
    return amount;
  }

  public void setAmount(BigDecimal amount) {
    this.amount = amount;
  }

  public BigDecimal getGrossUnitPrice() {
    return grossUnitPrice;
  }

  public void setGrossUnitPrice(BigDecimal grossUnitPrice) {
    this.grossUnitPrice = grossUnitPrice;
  }

  public boolean isAmountFixed() {
    return isAmountFixed;
  }

  public void setAmountFixed(boolean isAmountFixed) {
    this.isAmountFixed = isAmountFixed;
  }

  public boolean isGrossUnitPriceFixed() {
    return isGrossUnitPriceFixed;
  }

  public void setGrossUnitPriceFixed(boolean isGrossUnitPriceFixed) {
    this.isGrossUnitPriceFixed = isGrossUnitPriceFixed;
  }

  public boolean isQuantityFixed() {
    return isQuantityFixed;
  }

  public void setQuantityFixed(boolean isQuantityFixed) {
    this.isQuantityFixed = isQuantityFixed;
  }

  public boolean isTaxFixed() {
    return isTaxFixed;
  }

  public void setTaxFixed(boolean isTaxFixed) {
    this.isTaxFixed = isTaxFixed;
  }

  public boolean isTotalFixed() {
    return isTotalFixed;
  }

  public void setTotalFixed(boolean isTotalFixed) {
    this.isTotalFixed = isTotalFixed;
  }

  public boolean isUnitPriceFixed() {
    return isUnitPriceFixed;
  }

  public void setUnitPriceFixed(boolean isUnitPriceFixed) {
    this.isUnitPriceFixed = isUnitPriceFixed;
  }

  public String getPromotionMark() {
    return promotionMark;
  }

  public void setPromotionMark(String promotionMark) {
    this.promotionMark = promotionMark;
  }

  public BigDecimal getQuantity() {
    return quantity;
  }

  public void setQuantity(BigDecimal quantity) {
    this.quantity = quantity;
  }

  public BigDecimal getTax() {
    return tax;
  }

  public void setTax(BigDecimal tax) {
    this.tax = tax;
  }

  public BigDecimal getTaxRate() {
    return taxRate;
  }

  public void setTaxRate(BigDecimal taxRate) {
    this.taxRate = taxRate;
  }

  public BigDecimal getTotal() {
    return total;
  }

  public void setTotal(BigDecimal total) {
    this.total = total;
  }

  public BigDecimal getUnitPrice() {
    return unitPrice;
  }

  public void setUnitPrice(BigDecimal unitPrice) {
    this.unitPrice = unitPrice;
  }

  public void clearFixed() {
    this.setAmountFixed(false);
    this.setTaxFixed(false);
    this.setTotalFixed(false);
    this.setQuantityFixed(false);
    this.setUnitPriceFixed(false);
    this.setGrossUnitPriceFixed(false);
  }
}
